// pages/mine/mine.js
const request = require("../../utils/request1.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    MineList:'',
    image: 'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
    list:[
      {id:1,text:"待付款",iamge:"/image/待付款.png",path:"/pages/OrderDetails/OrderDetails"},
      {id:2,text:"待收货",iamge:"/image/待收货.png",path:"/pages/OrderDetails1/OrderDetails1"},
      {id:3,text:"租赁中",iamge:"/image/租赁到期.png",path:"/pages/OrderDetails2/OrderDetails2"},
    ],
    list1:[
      {id:1,text:"收货地址",iamge:"/image/地址.png",path:'/pages/management/management'},
      {id:2,text:"联系我们",iamge:"/image/客服.png",path:''},
      {id:3,text:"意见反馈",iamge:"/image/意见.png",path:'/pages/feedback/feedback'},
      {id:4,text:"设置",iamge:"/image/设置.png",path:'/pages/setup/setup'},
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getMineList()
  },
    // 获取个人信息
    getMineList(){
      const _this = this
      request.wxRequest('user/user', function (err, data) {
        console.log(data.data.user);
        if (err) {
          // 失败；
        } else {
          _this.setData({
            MineList: data.data.user
          })
        }
      }, 'GET', {
        id:2,
      })
  },
    // 租赁订单
    goTo (e) {
      console.log(e);
      const path = e.currentTarget.dataset.url
     wx.navigateTo({
       url: path,
     })
    },
    // 跳转租赁订单
    goOrders(){
      wx.navigateTo({
        url: '/pages/orders/orders',
      })
    },
  // 常用功能
  navigateToPath (e) {
    console.log(e);
    const path = e.currentTarget.dataset.url
   wx.navigateTo({
     url: path,
   })
  },
  goInformation(){
    wx.navigateTo({
      url: '/pages/information/information',
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})